﻿using System.Collections.Generic;

namespace Vestras.StarCraft2.Luna.Parser.Ast {
    public sealed class Function : EntityWithBlock {
        List<Variable> parameters = new List<Variable>();

        public string Name { get; internal set; }
        public Modifiers Modifiers { get; internal set; }
        public TypeReference Type { get; internal set; }
        public Function Prototype { get; internal set; }
        public bool IsPrototype { get; internal set; }
        public bool IsNative { get; internal set; }
        public List<Variable> Parameters {
            get {
                return parameters;
            }
            internal set {
                parameters = value;
            }
        }

        public bool ReturnsValue {
            get;
            set;
        }

        public int OrderIndex {
            get;
            set;
        }

        public override string ToString() {
            return GetType().Name + " Name = [ " + Name + " ], Type = [ " + Type + " ]";
        }
    }
}
